//
//  HMUser.m
//  SinaWeiBo
//
//  Created by WGP on 16/4/16.
//  Copyright © 2016年 WGP. All rights reserved.
//

#import "HMUser.h"

@implementation HMUser

+(instancetype)userWithDict:(NSDictionary *)dict
{
    id obj = [[self alloc] init];
    [obj setValuesForKeysWithDictionary:dict];
    return obj;
}

-(void)setVerified_type:(int)verified_type
{
    _verified_type = verified_type;
    if (verified_type == 0) {
        _verified_typeName = @"avatar_vip";
    }
    else if (verified_type == 220)
    {
        _verified_typeName = @"avatar_grassroot";
    }
    else
    {
        _verified_typeName = @"avatar_enterprise_vip";
    }
}

-(void)setProfile_image_url:(NSString *)profile_image_url
{
    _profile_image_url = profile_image_url;
    _profileImageURL = [NSURL URLWithString:profile_image_url];
}

-(void)setMbrank:(int)mbrank
{
    _mbrank = mbrank;
    if (mbrank > 0 && mbrank <= 6) {
        
        _mbrankImageName = [NSString stringWithFormat:@"common_icon_membership_level%zd",mbrank];
    }
    else
    {
        _mbrankImageName = @"common_icon_membership_expired";
    }
    
}

-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{}
@end
